可以通过 charge
对象的查询接口查询某一个 charge
对象的退款列表,也可以通过 refund
对象的 id 查询一个已创建的 refund
对象。可以在 Webhooks 通知之前,通过查询接口确认退款状态。
请求参数 | 描述 |
---|---|
CHARGE_ID required string | 退款的 charge 对象 id ,该参数仅需要填写在请求地址内。 |
REFUND_ID required string | 查询的 refund 对象 id ,该参数仅需要填写在请求地址内。 |
返回
返回一个已存在的 refund
对象或者一个错误,详见 错误。
GET https://api.pingxx.com/v1/charges/{CHARGE_ID}/refunds/{REFUND_ID}
$charge = \Pingpp\Charge::retrieve({CHARGE_ID}); $refund = $charge->refunds->retrieve({REFUND_ID});
Charge ch = Charge.retrieve({CHARGE_ID}); Refund re = ch.refunds->retrieve({REFUND_ID});
ch = Pingpp::Charge.retrieve({CHARGE_ID}) re = ch.refunds.retrieve({REFUND_ID})
pingpp.charges.retrieveRefund(
{CHARGE_ID},
{REFUND_ID},
function(err, refund) {
}
);
ch = pingpp.Charge.retrieve('CHARGE_ID')
re = ch.refunds.retrieve('REFUND_ID')
re, err := refund.Get("CHARGE_ID", "REFUND_ID")
retrieve(String chId, String reId)
curl https://api.pingxx.com/v1/charges/ch_L8qn10mLmr1GS8e5OODmHaL4/refunds/re_TmbvDKHiXLCSG0mnj9jnDyjA \ -u sk_test_ibbTe5jLGCi5rzfH4OqPW9KC:
\Pingpp\Pingpp::setApiKey('sk_test_ibbTe5jLGCi5rzfH4OqPW9KC');
$ch = \Pingpp\Charge::retrieve('ch_L8qn10mLmr1GS8e5OODmHaL4');
$refund = $ch->refunds->retrieve('re_TmbvDKHiXLCSG0mnj9jnDyjA');
Pingpp.apiKey = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC";
Charge ch = Charge.retrieve("ch_L8qn10mLmr1GS8e5OODmHaL4");
Refund re = ch.getRefunds().retrieve("re_TmbvDKHiXLCSG0mnj9jnDyjA");
require "pingpp"
Pingpp.api_key = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC"
ch = Pingpp::Charge.retrieve("ch_L8qn10mLmr1GS8e5OODmHaL4")
re = ch.refunds.retrieve("re_TmbvDKHiXLCSG0mnj9jnDyjA")
var pingpp = require('pingpp')('sk_test_ibbTe5jLGCi5rzfH4OqPW9KC');
pingpp.charges.retrieveRefund(
"ch_L8qn10mLmr1GS8e5OODmHaL4",
"re_TmbvDKHiXLCSG0mnj9jnDyjA",
function(err, refund) {
// 异步调用
}
);
pingpp.api_key = 'sk_test_ibbTe5jLGCi5rzfH4OqPW9KC'
import pingpp
ch = pingpp.Charge.retrieve('ch_L8qn10mLmr1GS8e5OODmHaL4')
re = ch.refunds.retrieve('re_TmbvDKHiXLCSG0mnj9jnDyjA')
pingpp.Key = "sk_test_ibbTe5jLGCi5rzfH4OqPW9KC"
refund, err := refund.Get("ch_L8qn10mLmr1GS8e5OODmHaL4", "re_TmbvDKHiXLCSG0mnj9jnDyjA")
try {
Refund re = Refund.create(chId, reId);
Console.WriteLine(re);
} catch (AuthenticationException e) {
Console.WriteLine(e.Message.ToString());
}
{
"id": "re_y1u944PmfnrTHyvnL0nD0iD1",
"object": "refund",
"order_no": "y1u944PmfnrTHyvnL0nD0iD1",
"amount": 1,
"created": 1409634160,
"succeed": true,
"status": "succeeded",
"time_succeed": 1409634192,
"description": "Refund Description",
"failure_code": null,
"failure_msg": null,
"metadata": {},
"charge": "ch_L8qn10mLmr1GS8e5OODmHaL4",
"charge_order_no": "123456789",
"transaction_no": "2004450349201512090096425284",
"funding_source": null,
"extra": {}
}